package com.bobo.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import javax.validation.constraints.*;

import com.bobo.common.valid.AddGroup;
import com.bobo.common.valid.ListValue;
import com.bobo.common.valid.UpdateGroup;
import com.bobo.common.valid.UpdateStatusGroup;
import lombok.Data;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.URL;


/**
 * 品牌
 * 
 * @author xulinbo
 * @email xulinbo@gmail.com
 * @date 2020-11-20 17:02:05
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@NotNull(message = "修改品牌时订单必须有指定的品牌号",groups = {UpdateGroup.class})
	@Null(message = "新增品牌时订单必须有指定的品牌号",groups = {AddGroup.class})
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotEmpty(message = "您所提交的品牌名称不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotBlank(groups = {AddGroup.class})
	@URL(message = "你所提交的商品logo必须是链接",groups={AddGroup.class,UpdateGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(groups = {AddGroup.class, UpdateGroup.class})
	@ListValue(vals={1,2},groups = {AddGroup.class, UpdateStatusGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty(groups={AddGroup.class})
	@Pattern(regexp="^[a-zA-Z]$",message = "检索首字母必须是一个字母",groups={AddGroup.class,UpdateGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@Min(value = 0,message = "排序的序列号不能为负数")
	@NotNull(groups={AddGroup.class})
	private Integer sort;

}
